package com.liveinstars.post.business.service;

import com.liveinstars.post.business.model.entity.Post;
import com.liveinstars.post.business.model.entity.Report;
import com.liveinstars.post.business.model.enums.PostStatus;
import com.liveinstars.post.business.model.vo.PostDetailVO;
import com.liveinstars.post.business.model.vo.PostListVO;
import com.liveinstars.post.business.service.base.BasePostService;
import org.springframework.data.domain.Page;
import org.springframework.lang.NonNull;

/**
 * Report service interface.
 *
 * @author johnniang
 * @author ryanwang
 * @date 2019-04-24
 */
public interface ReportService extends BasePostService<Report> {

    /**
     * Creates a sheet.
     *
     * @param sheet    sheet must not be null
     * @param autoSave autoSave
     * @return created sheet
     */
    @NonNull
    Report createBy(@NonNull Report sheet, boolean autoSave);



    /**
     * Gets by url
     *
     * @param status post status must not be null
     * @param slug   post slug must not be blank
     * @return sheet
     */
    @Override
    Report getBy(PostStatus status, String slug);


    /**
     * Converts to list dto page.
     *
     * @param sheetPage sheet page must not be nulls
     * @return a page of sheet list dto
     */
    @NonNull
    Page<PostListVO> convertToListVo(@NonNull Page<Report> sheetPage);

    /**
     * 包含了用户距离信息
     */
    @NonNull
    Page<PostListVO> convertToListVo(@NonNull Page<Report> sheetPage, Integer userId);


    @NonNull
    PostDetailVO convertToDetailVoByUserId(@NonNull Report post, Integer userId);
}
